package com.ruoyi.ctcx.service.impl;

import java.math.BigDecimal;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ctcx.mapper.TbInsuranceContractRiskRealMapper;
import com.ruoyi.ctcx.domain.TbInsuranceContractRiskReal;
import com.ruoyi.ctcx.service.ITbInsuranceContractRiskRealService;

/**
 * 保险合同风控费用支付Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-22
 */
@Service
public class TbInsuranceContractRiskRealServiceImpl implements ITbInsuranceContractRiskRealService 
{
    @Autowired
    private TbInsuranceContractRiskRealMapper tbInsuranceContractRiskRealMapper;

    /**
     * 查询保险合同风控费用支付
     * 
     * @param id 保险合同风控费用支付主键
     * @return 保险合同风控费用支付
     */
    @Override
    public TbInsuranceContractRiskReal selectTbInsuranceContractRiskRealById(Long id)
    {
        return tbInsuranceContractRiskRealMapper.selectTbInsuranceContractRiskRealById(id);
    }

    /**
     * 查询保险合同风控费用支付列表
     * 
     * @param tbInsuranceContractRiskReal 保险合同风控费用支付
     * @return 保险合同风控费用支付
     */
    @Override
    public List<TbInsuranceContractRiskReal> selectTbInsuranceContractRiskRealList(TbInsuranceContractRiskReal tbInsuranceContractRiskReal)
    {
        return tbInsuranceContractRiskRealMapper.selectTbInsuranceContractRiskRealList(tbInsuranceContractRiskReal);
    }

    /**
     * 新增保险合同风控费用支付
     * 
     * @param tbInsuranceContractRiskReal 保险合同风控费用支付
     * @return 结果
     */
    @Override
    public int insertTbInsuranceContractRiskReal(TbInsuranceContractRiskReal tbInsuranceContractRiskReal)
    {
        tbInsuranceContractRiskReal.setCreateTime(DateUtils.getNowDate());
        return tbInsuranceContractRiskRealMapper.insertTbInsuranceContractRiskReal(tbInsuranceContractRiskReal);
    }

    /**
     * 修改保险合同风控费用支付
     * 
     * @param tbInsuranceContractRiskReal 保险合同风控费用支付
     * @return 结果
     */
    @Override
    public int updateTbInsuranceContractRiskReal(TbInsuranceContractRiskReal tbInsuranceContractRiskReal)
    {
        tbInsuranceContractRiskReal.setUpdateTime(DateUtils.getNowDate());
        return tbInsuranceContractRiskRealMapper.updateTbInsuranceContractRiskReal(tbInsuranceContractRiskReal);
    }

    /**
     * 批量删除保险合同风控费用支付
     * 
     * @param ids 需要删除的保险合同风控费用支付主键
     * @return 结果
     */
    @Override
    public int deleteTbInsuranceContractRiskRealByIds(Long[] ids)
    {
        return tbInsuranceContractRiskRealMapper.deleteTbInsuranceContractRiskRealByIds(ids);
    }

    /**
     * 删除保险合同风控费用支付信息
     * 
     * @param id 保险合同风控费用支付主键
     * @return 结果
     */
    @Override
    public int deleteTbInsuranceContractRiskRealById(Long id)
    {
        return tbInsuranceContractRiskRealMapper.deleteTbInsuranceContractRiskRealById(id);
    }

    @Override
    public BigDecimal getAllRealAmountByRiskId(Long riskId) {
        return tbInsuranceContractRiskRealMapper.getAllRealAmountByRiskId(riskId);
    }
}
